import Mock from 'mockjs'
Mock.mock('/api/mock', () => {
  return Mock.mock({
    "navlist|4": [
      {
        pp: "@ctitle(4)",
        xx: "@ctitle(4)",
        "children|4": [
          {
            title: "@ctitle(4)",
            img: "@image(100x100,@color)",
            "price|80-900": 80,
          },
        ],
      },
    ],
  })
});

Mock.mock('/allkill', () => {
  return Mock.mock({
    'list|10': [{
      id: '@id',
      img: '@image(100x100,@color)',
      title: '@ctitle',
      text: '@cword(10,20)',
      'money|0-100': 0,
      'lastMoney|100-200': 0,
      'JD|0-100': 0,
    },],
  })
})
//购物车列表
Mock.mock("/getList", {
  "list|3-5": [{
    "id": "@id",
    "img": "@image(100x100,@color,@cname)",
    "name": "@cname",
    "title": "@ctitle",
    "price|10-100": 10,
    "flag": false
  }],
  "HotList|50": [{
    "id": "@id",
    "img": "@image(100x100,@color,@cname)",
    "name": "@cname",
    "title": "@ctitle",
    "price|100-1000": 1,
    "flag": false
  }]
})
//砍价页面数据
Mock.mock('/homeList', () => {
  return Mock.mock({
    'list|10': [{
      title: '@ctitle(4)',
      img: '@image(100x100,@color)',
      'price|1-5': 1,
    },],
  })

})
//直播列表数据
Mock.mock('/showList', () => {
  return Mock.mock({
    'list|60': [{
      img: '@image(130x130,@color)',
      title: '@ctitle(15,20)',
      'price|1-888': 1,
      'num|1-100': 2,
      'url|10': '@image(130x130,@color)',
      "message|1": [true, false]
    },],
  })
})

Mock.mock("/getGroup", () => {
  return Mock.mock({
    "list|2": [{
      "id": "@id",
      "img": "@image(100x100,@color)",
      "title": "@ctitle(40,50)",            // 拼团商品信息
      "joinnum|3-6": 1,             // 已参加拼团人数
      "residuenum|1-3": 1,          // 剩余人数
      "price|200-300": 1,           // 商品原价
      "discountprice|100-250": 1,   // 拼团折扣价格
      "limited|10-20": 1,           // 限购商品数量
      "totalsell|5-10": 1,          // 累计销量 
      "comment|5-10": [{             // 评论
        "img": "@image(100x100,@color)",
        "portrait": "@image(50x50,@color)",
        "title": "@ctitle",
        "name": "@cname"
      }],
      "children|2-4": [{    // 详情
        "img": "@image(100x100,@color)",
        "title": "@ctitle",
      }]
    }]
  })
})

Mock.mock("/getGroupOne", () => {
  return Mock.mock({
    "list": [{
      "id": "@id",
      "img": "@image(100x100,@color)",
      "title": "@ctitle(40,60)",            // 拼团商品信息
      "joinnum|3-6": 1,             // 已参加拼团人数
      "residuenum|1-3": 1,          // 剩余人数
      "price|200-300": 1,           // 商品原价
      "discountprice|100-250": 1,   // 拼团折扣价格
      "limited|10-20": 1,           // 限购商品数量
      "totalsell|5-10": 1,          // 累计销量 
      "comment|5-10": [{             // 评论
        "img": "@image(100x100,@color)",
        "portrait": "@image(50x50,@color)",
        "title": "@ctitle",
        "name": "@cname"
      }],
      "children|2-4": [{    // 详情
        "img": "@image(100x100,@color)",
        "title": "@ctitle",
      }]
    }]
  })
})